﻿// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!"+persion(1,2));

int sbyteSize =sizeof(sbyte);
Console.WriteLine("sbyte大小:"+sbyteSize);

int intSize =sizeof(int);
Console.WriteLine("int大小:"+intSize);

int longSize =sizeof(long);
Console.WriteLine("long大小:"+longSize);

int shortSize =sizeof(short);
Console.WriteLine("short大小:"+shortSize);

//无符号
int usbyteSize =sizeof(byte);
Console.WriteLine("byte大小:"+usbyteSize);

int uintSize =sizeof(uint);
Console.WriteLine("uint大小:"+uintSize);

int ulongSize =sizeof(ulong);
Console.WriteLine("ulong大小:"+ulongSize);

int ushortSize =sizeof(ushort);
Console.WriteLine("ushort大小:"+ushortSize);

//浮点数
int floatSize =sizeof(float);
int doubleSize =sizeof(double);
int decimalSize =sizeof(decimal);
Console.WriteLine("floatSize:"+floatSize);
Console.WriteLine("doubleSize:"+doubleSize);
Console.WriteLine("decimalSize:"+decimalSize);

//特殊
int boolSize =sizeof(bool);
int booleanSize =sizeof(Boolean);
int charSize =sizeof(char);

//sizeof不能得到string的长度大小的
//int stringSize =sizeof(string);

Console.WriteLine("boolSize:"+boolSize);
Console.WriteLine("booleanSize:"+booleanSize);
Console.WriteLine("charSize:"+charSize);


static int persion(int a, int b)
{
    return a + b;
}
